-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.x] Implement PHPStan #596
Conversation
@@ -261,7 +274,7 @@ protected function bootListeners(): self | |||
protected function bootMacros(): self | |||
{ | |||
Collection::macro('firstForCurrentStore', function () { | |||
/** @var Collection $this */ | |||
/** @var Collection<> $this */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works out to a Collection<mixed>
type by default, which is what you want here with the macro. I could specify it explicitly if preferable?
Do we really want level 8 with all those ignores? And a bit to many docblocks if you ask me. Laravel itself is running level 1: https://github.com/laravel/framework/blob/11.x/phpstan.src.neon.dist |
I agree with @royduin . Also quite a few ignores. Rather have a lower level then this much ignores. |
I've lowered it to level 1, allowing me to also make a specific ignore for all eventy errors, which removed all but one of the remaining phpstan ignores 🙂 |
Adds PHPStan as a workflow and fixes all (current) errors that come out of PHPStan level 8.
Includes some other fixes that I happened to come across, for example dynamic models not being used properly.
I've done a quick test on an existing project to see if I've made any errors, but I could not spot any. Nevertheless, this is of course still a hugely breaking change.